Skip to content

feat: add skill-load coverage for agent integrations [2/3]#392

Merged
rapids-bot[bot] merged 8 commits into
NVIDIA:mainfrom
willkill07:wkk_relay-443-integrations
Jul 11, 2026
Merged

feat: add skill-load coverage for agent integrations [2/3]#392
rapids-bot[bot] merged 8 commits into
NVIDIA:mainfrom
willkill07:wkk_relay-443-integrations

Conversation

@willkill07

@willkill07 willkill07 commented Jul 8, 2026

Copy link
Copy Markdown
Member

Overview

Extends RELAY-443 coverage into the supported agent integrations. This is the second commit in a three-PR cumulative stack; all three PRs target upstream main as requested, so this PR temporarily includes the first commit until it merges.

  • I confirm this contribution is my own work, or I have the right to submit it under this project's license.
  • I searched existing issues and open pull requests, and this does not duplicate existing work.

Details

  • Adds skill-load hook coverage for the Claude Code and Codex coding-agent integrations.
  • Adds real LangChain, LangGraph, and Deep Agents coverage while preserving the existing Deep Agents configured-skills mark.
  • Keeps all test bodies outside implementation src trees.
  • Removes all OpenClaw changes; that integration work will be refactored separately.

Validation: just test-rust, just test-python, just test-node, and uv run pre-commit run --all-files.

Breaking changes: none.

Where should the reviewer start?

Start with crates/core/src/api/skill_load.rs, then review the coding-agent hook configurations and Python integration coverage.

Related Issues: (use one of the action keywords Closes / Fixes / Resolves / Relates to)

  • Relates to: RELAY-443

Summary by CodeRabbit

  • Tests
    • Added integration coverage confirming skill.load marks are emitted when structured skills are read via supported middleware and tooling.
    • Verified skill.load event payloads include skill_name plus attribution metadata (skill_load_source, tool_name) and that the parent_uuid links back to the associated read_file start scope.
    • Extended coverage across DeepAgents middleware, LangChain middleware, LangGraph execution, and direct tool usage.

@willkill07 willkill07 requested a review from a team as a code owner July 8, 2026 23:42
@github-actions github-actions Bot added size:XL PR is extra large Feature a new feature lang:js PR changes/introduces Javascript/Typescript code lang:python PR changes/introduces Python code lang:rust PR changes/introduces Rust code labels Jul 8, 2026
@coderabbitai

coderabbitai Bot commented Jul 8, 2026

Copy link
Copy Markdown

Review Change Stack

Walkthrough

Adds tests confirming structured skill reads emit skill.load marks and preserve their metadata and parent scope linkage across direct tools, LangChain, LangGraph, and DeepAgents integrations.

Changes

Skill-load mark validation

Layer / File(s) Summary
Direct skill-load mark contract
python/tests/test_tools.py
Validates event ordering, parent linkage, skill_name, and structured-read metadata for direct read_file calls.
Middleware and graph propagation
python/tests/integrations/...
Verifies skill.load marks and tool responses through LangChain, LangGraph, and DeepAgents execution paths.

Estimated code review effort: 2 (Simple) | ~10 minutes

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 11.11% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title follows Conventional Commits and matches the main change to skill-load coverage for agent integrations.
Description check ✅ Passed The description follows the required template sections and includes overview, details, reviewer start, checklist items, and related issue reference.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands.

@willkill07 willkill07 added this to the 0.6 milestone Jul 8, 2026
@willkill07 willkill07 self-assigned this Jul 8, 2026
@willkill07 willkill07 marked this pull request as draft July 8, 2026 23:44
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

License Diff

Compared against origin/main.

Lockfile license changes

Lockfile License Changes

Rust

Added

  • None

Removed

  • None

Updated/Changed

  • None

Node

Added

  • None

Removed

  • None

Updated/Changed

  • None

Python

Added

  • None

Removed

  • None

Updated/Changed

  • None
Status output
[license-diff] selected languages: rust, node, python
[license-diff] generating current inventory
[license-diff] current: generating Rust inventory
[license-diff] current: Rust inventory complete (378 packages)
[license-diff] current: generating Node inventory
[license-diff] current: Node inventory complete (363 packages)
[license-diff] current: generating Python inventory
[license-diff] current: Python inventory complete (105 packages)
[license-diff] current inventory complete
[license-diff] checking out base ref origin/main into a temporary worktree
[license-diff] base: generating Rust inventory
[license-diff] base: Rust inventory complete (378 packages)
[license-diff] base: generating Node inventory
[license-diff] base: Node inventory complete (363 packages)
[license-diff] base: generating Python inventory
[license-diff] base: Python inventory complete (105 packages)
[license-diff] base inventory complete
[license-diff] removing temporary base worktree
[license-diff] comparing inventories
[license-diff] rendering Markdown output
[license-diff] done

Comment thread integrations/openclaw/src/hook-replay/tool.ts Outdated
Comment thread integrations/openclaw/src/hook-replay/skill-load.ts Outdated

Copy link
Copy Markdown
Contributor

I’d drop the OpenClaw-specific skill-load handling from this stack. With the CLI/sidecar pivot, extending hook replay with eager/fallback state looks like unnecessary complexity. I’d keep the shared core and other integration changes, remove the corresponding OpenClaw changes from 392/393, and handle managed OpenClaw skill marks at the sidecar boundary if we still need them. That would also make my OpenClaw-specific inline comments moot.

@github-actions github-actions Bot removed the lang:js PR changes/introduces Javascript/Typescript code label Jul 10, 2026
@willkill07 willkill07 changed the title feat: detect skill loads in agent integrations [2/3] feat: add skill-load coverage for agent integrations [2/3] Jul 10, 2026
@willkill07 willkill07 force-pushed the wkk_relay-443-integrations branch from 89db64d to 4a09ce7 Compare July 10, 2026 13:54
willkill07 and others added 6 commits July 10, 2026 18:01
Signed-off-by: Will Killian <wkillian@nvidia.com>
UserPromptExpansion is only present in Claude Code's plugin hook
whitelist from 2.1.116. Older hosts reject the entire plugin hooks
file on the unknown event name and silently load no relay hooks,
for both the transparent-run temp plugin and the marketplace plugin.

Document the verified floor on HOOK_EVENTS, make doctor warn when the
probed Claude Code predates it, and state the requirement in the
plugin README.

Signed-off-by: Zhongxuan Wang <daniewang@nvidia.com>
(cherry picked from commit d3b8959)
Signed-off-by: Will Killian <wkillian@nvidia.com>
Signed-off-by: Will Killian <wkillian@nvidia.com>
Signed-off-by: Will Killian <wkillian@nvidia.com>
Signed-off-by: Will Killian <wkillian@nvidia.com>
@willkill07 willkill07 marked this pull request as ready for review July 11, 2026 00:12
@github-actions github-actions Bot added size:M PR is medium and removed size:XL PR is extra large lang:rust PR changes/introduces Rust code labels Jul 11, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@python/tests/integrations/deepagents_tests/test_deepagents_integration.py`:
- Around line 332-369: Add a parent-scope-correlation assertion to
test_skill_load_mark_survives_deepagents_middleware: identify the read_file
start ScopeEvent from the captured lifecycle events and assert
marks[0].parent_uuid matches that event’s scope UUID, consistent with the
sibling LangChain and LangGraph tests.

In `@python/tests/integrations/langchain_tests/test_middleware.py`:
- Around line 414-427: Replace the manual subscriber lifecycle in the affected
test with the existing subscribed_events pytest fixture, as used by the
LangGraph and DeepAgents integration tests. Remove the explicit register, flush,
and deregister calls around wrap_tool_call, and assert against the fixture’s
collected events so all skill-load tests share the same setup.

In `@python/tests/test_tools.py`:
- Around line 71-78: Replace the manual events list, subscriber registration,
flush, and finally-based deregistration in the affected test with the shared
subscribed_events pytest fixture. Update assertions to read captured events from
that fixture, and apply the same fixture-based setup to the corresponding
LangChain middleware test to remove duplicated subscription boilerplate.
- Line 72: Replace the unnecessary lambda passed to subscribers.register in the
test with the existing events.append method directly, preserving the current
event collection behavior and matching the integration test pattern.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Enterprise

Run ID: 0a02cd5e-285c-4ca7-bed9-dffa1af8b009

📥 Commits

Reviewing files that changed from the base of the PR and between 9b0c078 and 9983881.

📒 Files selected for processing (4)
  • python/tests/integrations/deepagents_tests/test_deepagents_integration.py
  • python/tests/integrations/langchain_tests/test_middleware.py
  • python/tests/integrations/langgraph_tests/test_langgraph_integration.py
  • python/tests/test_tools.py
📜 Review details
⏰ Context from checks skipped due to timeout. (2)
  • GitHub Check: CodeRabbit
  • GitHub Check: Check / Run
🧰 Additional context used
📓 Path-based instructions (11)
**/*.{rs,py}

📄 CodeRabbit inference engine (AGENTS.md)

Follow binding naming conventions in Rust and Python: use snake_case.

Files:

  • python/tests/test_tools.py
  • python/tests/integrations/langgraph_tests/test_langgraph_integration.py
  • python/tests/integrations/deepagents_tests/test_deepagents_integration.py
  • python/tests/integrations/langchain_tests/test_middleware.py
**/*.{rs,py,js,mjs,cjs,ts,tsx}

📄 CodeRabbit inference engine (AGENTS.md)

**/*.{rs,py,js,mjs,cjs,ts,tsx}: Use Json = serde_json::Value in Rust-facing runtime APIs where the existing code expects JSON payloads.
Use Result<T> with FlowError in core runtime paths, and keep errors explicit and binding-appropriate at the wrapper layer.
Keep async behavior on the existing tokio-based model; bindings should preserve callback and future lifetimes rather than blocking or hiding async work unexpectedly.

Files:

  • python/tests/test_tools.py
  • python/tests/integrations/langgraph_tests/test_langgraph_integration.py
  • python/tests/integrations/deepagents_tests/test_deepagents_integration.py
  • python/tests/integrations/langchain_tests/test_middleware.py
**/*.py

📄 CodeRabbit inference engine (CONTRIBUTING.md)

**/*.py: When changing the Python wrapper package, tests, or docs tooling, lint with Ruff (E, F, W, I), format with Ruff formatter (120-character lines, double quotes), and pass ty type checking.
Add the SPDX license header to all Python source files using the # comment form.

Files:

  • python/tests/test_tools.py
  • python/tests/integrations/langgraph_tests/test_langgraph_integration.py
  • python/tests/integrations/deepagents_tests/test_deepagents_integration.py
  • python/tests/integrations/langchain_tests/test_middleware.py
**/*.{rs,py,go,js,ts,c,h}

📄 CodeRabbit inference engine (CONTRIBUTING.md)

Use language-appropriate naming conventions: Rust snake_case, C FFI exports prefixed nemo_relay_, Go PascalCase, Node.js camelCase, and Python snake_case.

Files:

  • python/tests/test_tools.py
  • python/tests/integrations/langgraph_tests/test_langgraph_integration.py
  • python/tests/integrations/deepagents_tests/test_deepagents_integration.py
  • python/tests/integrations/langchain_tests/test_middleware.py
{crates/**/src/**/*.rs,python/**/*.py}

📄 CodeRabbit inference engine (.agents/skills/maintain-dynamic-plugins/SKILL.md)

Do not add tests under src; Rust tests belong in crate tests/ trees, and Python SDK tests belong under python/tests.

Files:

  • python/tests/test_tools.py
  • python/tests/integrations/langgraph_tests/test_langgraph_integration.py
  • python/tests/integrations/deepagents_tests/test_deepagents_integration.py
  • python/tests/integrations/langchain_tests/test_middleware.py
**/*.{py,go,js,ts}

📄 CodeRabbit inference engine (.agents/skills/maintain-observability/SKILL.md)

Keep Python, Go, and Node.js config objects and subscriber/exporter methods aligned so all bindings expose the same logical knobs and semantics.

Files:

  • python/tests/test_tools.py
  • python/tests/integrations/langgraph_tests/test_langgraph_integration.py
  • python/tests/integrations/deepagents_tests/test_deepagents_integration.py
  • python/tests/integrations/langchain_tests/test_middleware.py
python/tests/**/*.py

📄 CodeRabbit inference engine (.agents/skills/test-python-binding/SKILL.md)

python/tests/**/*.py: Pytest is used to run tests.
Do not add @pytest.mark.asyncio to any test; async tests are automatically detected and run by the async runner.
Do not add a -> None return type annotation to test functions.
When mocking a class, do not define a new class; use unittest.mock.MagicMock or unittest.mock.AsyncMock, with the spec constructor argument when necessary.
Name mocked classes with the mock prefix, not fake.
Prefer pytest fixtures over helper methods.
Do not repeat fixtures; if a fixture is needed in multiple test files, place it in a conftest.py file.
When creating a fixture, use @pytest.fixture(name="<fixture_name>"[, scope="<scope>"]) and define the fixture function as def <fixture_name>_fixture() -> <return_type>:; only specify scope when it is not function.
Prefer pytest.mark.parametrize over creating individual tests for different input types.

Files:

  • python/tests/test_tools.py
  • python/tests/integrations/langgraph_tests/test_langgraph_integration.py
  • python/tests/integrations/deepagents_tests/test_deepagents_integration.py
  • python/tests/integrations/langchain_tests/test_middleware.py
**/*

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

**/*: Format changed files with the language-native formatter before the final lint/test pass.
If dynamic plugin behavior changed, use maintain-dynamic-plugins and include the native SDK, worker protocol, Python SDK, docs, packaging, and Codecov surfaces in the validation plan.
If code changes alter APIs, bindings, commands, paths, packaging behavior, observability/adaptive semantics, or documented best practices, update any dependent maintainer or consumer skills in the same branch.
During iteration, prefer uv run pre-commit run --files <changed files...>.
Before review or handoff, run uv run pre-commit run --all-files.

Files:

  • python/tests/test_tools.py
  • python/tests/integrations/langgraph_tests/test_langgraph_integration.py
  • python/tests/integrations/deepagents_tests/test_deepagents_integration.py
  • python/tests/integrations/langchain_tests/test_middleware.py
**/*.{rs,py,go,js,ts}

📄 CodeRabbit inference engine (.agents/skills/validate-change/SKILL.md)

If a language surface changed, always run that language's test target even when Rust core did not change.

Files:

  • python/tests/test_tools.py
  • python/tests/integrations/langgraph_tests/test_langgraph_integration.py
  • python/tests/integrations/deepagents_tests/test_deepagents_integration.py
  • python/tests/integrations/langchain_tests/test_middleware.py
**

⚙️ CodeRabbit configuration file

**:

AGENTS.md

This file provides guidance to agents, including Claude Code and OpenAI Codex, when working in this repository.

Project Overview

NeMo Relay is a multi-language agent runtime framework for execution scopes, lifecycle events, middleware, plugins, and observability around tool and LLM calls. The core runtime is Rust. Primary supported bindings are Rust, Python, and Node.js. Go and the raw C FFI are experimental and source-first.

The shared runtime model is:

  1. Scope stacks decide where work belongs and which scope-local behavior is visible.
  2. Middleware registries decide what guardrails and intercepts run around managed calls.
  3. Plugins install reusable runtime behavior from configuration.
  4. Events record runtime behavior in ATOF form.
  5. Subscribers and exporters consume events in-process or export them to ATIF, OpenTelemetry, OpenInference, or other backends.

Repository Structure

The repository layout separates the Rust runtime, language bindings,
documentation, integrations, and agent-facing skills.

crates/
  core/       # Rust core runtime crate, published as nemo-relay
  adaptive/   # Adaptive runtime primitives and plugin components
  python/     # PyO3 native extension for the Python package
  ffi/        # Raw C ABI layer used by downstream bindings such as Go
  node/       # NAPI Node.js binding and JavaScript/TypeScript entry points
python/
  nemo_relay/  # Python wrapper package: scopes, tools, LLM, middleware, typed helpers, plugins, adaptive helpers
  tests/      # Python tests
go/
  nemo_relay/  # Experimental Go CGo binding and tests
fern/         # Fern documentation site
scripts/      # Stable wrappers and helper scripts; build/test/docs entry points live in justfile
skills/       # Published Codex/agent skills for NeMo Relay usage patterns

Prerequisites

Insta...

Files:

  • python/tests/test_tools.py
  • python/tests/integrations/langgraph_tests/test_langgraph_integration.py
  • python/tests/integrations/deepagents_tests/test_deepagents_integration.py
  • python/tests/integrations/langchain_tests/test_middleware.py
{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}

⚙️ CodeRabbit configuration file

{crates/**/tests/**,python/tests/**,go/nemo_relay/**/*_test.go}: Tests should cover the behavior promised by the changed API surface, including error paths and cross-request isolation where relevant.
Prefer assertions on lifecycle events, scope stacks, middleware ordering, and binding parity over shallow smoke tests.

Files:

  • python/tests/test_tools.py
  • python/tests/integrations/langgraph_tests/test_langgraph_integration.py
  • python/tests/integrations/deepagents_tests/test_deepagents_integration.py
  • python/tests/integrations/langchain_tests/test_middleware.py
🪛 Ruff (0.15.20)
python/tests/test_tools.py

[warning] 72-72: Lambda may be unnecessary; consider inlining inner function

Inline function call

(PLW0108)

🔇 Additional comments (1)
python/tests/integrations/langgraph_tests/test_langgraph_integration.py (1)

127-160: LGTM!

Comment thread python/tests/integrations/langchain_tests/test_middleware.py Outdated
Comment thread python/tests/test_tools.py Outdated
Comment thread python/tests/test_tools.py Outdated
Signed-off-by: Will Killian <wkillian@nvidia.com>
@willkill07 willkill07 changed the title feat: add skill-load coverage for agent integrations [2/3] feat: add skill-load coverage for agent integrations Jul 11, 2026
@willkill07 willkill07 changed the title feat: add skill-load coverage for agent integrations feat: add skill-load coverage for agent integrations [2/3] Jul 11, 2026
@willkill07 willkill07 requested a review from mnajafian-nv July 11, 2026 00:42

@mnajafian-nv mnajafian-nv left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@willkill07

Copy link
Copy Markdown
Member Author

/merge

@rapids-bot rapids-bot Bot merged commit e1d93cb into NVIDIA:main Jul 11, 2026
37 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature a new feature lang:python PR changes/introduces Python code size:M PR is medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants